#pragma once

#include "NodeMap.h"

class CMapfileParser
{
public:
    CMapfileParser(void);
    ~CMapfileParser(void);

    static CString Parse(const CString& strMapfile, CNodePtrVec& vecNodes, 
        CPathPtrVec& vecPaths);

private:
    static CString ParseDesc(CStdioFile& file);
    static bool FirstPass(CStdioFile& file, CNodePtrVec& vecNodes);
    static bool SecondPass(CStdioFile& file, CNodePtrVec& vecNodes);
    static CNode* GetNodePointer(int id,  CNodePtrVec vecNodes);
    static CNode* ParseNodeFP(CString& strLine, int& iTok);
    static void ParseNodeSP(CString& strLine, int& iTok, CNode* n, 
        CNodePtrVec& vecNodes);
    static void ParsePaths(CStdioFile& file, const CNodePtrVec& vecNodes, 
        CPathPtrVec& vecPaths);
};
